home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Source / WinTlb / SHELLAPI.IDL < prev    next >
Text File  |  1997-05-30  |  26KB  |  746 lines

  1.  
  2. // Shell structures
  3.  
  4. typedef struct SHFILEINFO {
  5.         HICON       hIcon;                      // out: icon
  6.         int         iIcon;                      // out: icon index
  7.         DWORD       dwAttributes;               // out: SFGAO_ flags
  8. #if UNICODE
  9.         BYTE        szDisplayName[260 * 2];     // out: display name (or path)
  10.         BYTE        szTypeName[80 * 2];         // out: type name
  11. #else
  12.         BYTE        szDisplayName[260];         // out: display name (or path)
  13.         BYTE        szTypeName[80];             // out: type name
  14. #endif
  15. } SHFILEINFO;
  16.  
  17. typedef WORD FILEOP_FLAGS;
  18. // no POF_ flags currently defined
  19. typedef WORD PRINTEROP_FLAGS;
  20.  
  21. typedef struct SHFILEOPSTRUCT {
  22.         HWND            hwnd;
  23.         UINT            wFunc;
  24.         LONG            pFrom;
  25.         LONG            pTo;
  26.         FILEOP_FLAGS    fFlags;
  27.         BOOL            fAnyOperationsAborted;
  28.         LPVOID          hNameMappings;
  29.         LONG             lpszProgressTitle; // only used if FOF_SIMPLEPROGRESS
  30. } SHFILEOPSTRUCT;
  31.  
  32. typedef struct NOTIFYICONDATA {
  33.         DWORD cbSize;
  34.         HWND  hWnd;
  35.         UINT  uID;
  36.         UINT  uFlags;
  37.         UINT  uCallbackMessage;
  38.         HICON hIcon;
  39. #if UNICODE
  40.         BYTE  szTip[64 * 2];
  41. #else
  42.         BYTE  szTip[64];
  43. #endif
  44. } NOTIFYICONDATA;
  45.  
  46. typedef LONG BFFCALLBACK;
  47. // typedef int (CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
  48.  
  49. typedef struct BROWSEINFO {
  50.     HWND        hwndOwner;
  51.     LPCITEMIDLIST pidlRoot;
  52.     LONG /* LPTSTR */ pszDisplayName;// Return display name of item selected.
  53.     LONG /* LPCTSTR */ lpszTitle;    // text to go in the banner over the tree.
  54.     UINT         ulFlags;   // Flags that control the return stuff
  55.     BFFCALLBACK  lpfn;
  56.     LONG         lParam;    // extra info that's passed back in callbacks
  57.  
  58.     int          iImage;    // output var: where to return the Image index.
  59. } BROWSEINFO, *PBROWSEINFO, *LPBROWSEINFO;
  60.  
  61. // Browsing for directory.
  62. typedef enum EBROWSEOPTIONS {
  63.     BIF_RETURNONLYFSDIRS   = 0x0001,  // For finding a folder to start document searching
  64.     BIF_DONTGOBELOWDOMAIN  = 0x0002,  // For starting the Find Computer
  65.     BIF_STATUSTEXT         = 0x0004,
  66.     BIF_RETURNFSANCESTORS  = 0x0008,
  67.  
  68.     BIF_BROWSEFORCOMPUTER  = 0x1000,  // Browsing for Computers.
  69.     BIF_BROWSEFORPRINTER   = 0x2000,  // Browsing for Printers
  70.     BIF_BROWSEINCLUDEFILES = 0x4000   // Browsing for Everything
  71. } EBROWSEOPTIONS;
  72.  
  73.     //// Shell File Operations
  74.  
  75. typedef enum EFILEOPS {
  76.     FO_MOVE         = 0x0001,
  77.     FO_COPY         = 0x0002,
  78.     FO_DELETE       = 0x0003,
  79.     FO_RENAME       = 0x0004,
  80.  
  81.     FOF_MULTIDESTFILES      = 0x0001,
  82.     FOF_CONFIRMMOUSE        = 0x0002,
  83.     FOF_SILENT              = 0x0004, // don't create progress/report
  84.     FOF_RENAMEONCOLLISION   = 0x0008,
  85.     FOF_NOCONFIRMATION      = 0x0010, // Don't prompt the user.
  86.     FOF_WANTMAPPINGHANDLE   = 0x0020, // Fill in SHFILEOPSTRUCT.hNameMappings
  87.                                       // Must be freed using SHFreeNameMappings
  88.     FOF_ALLOWUNDO           = 0x0040,
  89.     FOF_FILESONLY           = 0x0080, // on *.*, do only files
  90.     FOF_SIMPLEPROGRESS      = 0x0100, // means don't show names of files
  91.     FOF_NOCONFIRMMKDIR      = 0x0200, // don't confirm making any needed dirs
  92.  
  93.     PO_DELETE               = 0x0013, // printer is being deleted
  94.     PO_RENAME               = 0x0014, // printer is being renamed
  95.     PO_PORTCHANGE           = 0x0020, // port this printer connected to is being changed
  96.                                       // if this id is set, the strings received by
  97.                                       // the copyhook are a doubly-null terminated
  98.                                       // list of strings.  The first is the printer
  99.                                       // name and the second is the printer port.
  100.     PO_REN_PORT             = 0x0034, // PO_RENAME and PO_PORTCHANGE at same time.
  101.  
  102.     // Some useful masks
  103.     FOF_COPYFLAGS =     FOF_MULTIDESTFILES | FOF_SILENT |
  104.                         FOF_RENAMEONCOLLISION | FOF_NOCONFIRMATION |
  105.                         FOF_ALLOWUNDO | FOF_FILESONLY |
  106.                         FOF_SIMPLEPROGRESS | FOF_NOCONFIRMMKDIR,
  107.  
  108.     FOF_MOVEFLAGS   =   FOF_COPYFLAGS,
  109.     FOF_RENAMEFLAGS =   FOF_COPYFLAGS,
  110.     FOF_DELETEFLAGS =   FOF_SILENT | FOF_NOCONFIRMATION |
  111.                         FOF_ALLOWUNDO | FOF_SIMPLEPROGRESS
  112.  
  113. } EFILEOPS;
  114.  
  115. typedef enum ESHARD {
  116.     [ helpstring("SHAddToRecentDocs: Add item identifier list") ]
  117.     SHARD_PIDL   = 0x00000001,
  118.     [ helpstring("SHAddToRecentDocs: Add path string") ]
  119.     #ifdef UNICODE
  120.     SHARD_PATH   = 0x00000003,
  121.     #else
  122.     SHARD_PATH   = 0x00000002,
  123.     #endif
  124.     SHARD_PATHA  = 0x00000002,
  125.     SHARD_PATHW  = 0x00000003
  126. } ESHARD;
  127.  
  128. typedef enum ESHGFI {
  129.     [ helpstring("SHGetFileInfo: Get icon") ]
  130.     SHGFI_ICON               = 0x00000100,
  131.     [ helpstring("SHGetFileInfo: Get display name") ]
  132.     SHGFI_DISPLAYNAME        = 0x00000200,
  133.     [ helpstring("SHGetFileInfo: Get type name") ]
  134.     SHGFI_TYPENAME           = 0x00000400,
  135.     [ helpstring("SHGetFileInfo: Get attributes") ]
  136.     SHGFI_ATTRIBUTES         = 0x00000800,
  137.     [ helpstring("SHGetFileInfo: Get icon location") ]
  138.     SHGFI_ICONLOCATION       = 0x00001000,
  139.     [ helpstring("SHGetFileInfo: Get EXE type") ]
  140.     SHGFI_EXETYPE            = 0x00002000,
  141.     [ helpstring("SHGetFileInfo: Get system icon index") ]
  142.     SHGFI_SYSICONINDEX       = 0x00004000,
  143.     [ helpstring("SHGetFileInfo: Put link overlay on icon") ]
  144.     SHGFI_LINKOVERLAY        = 0x00008000,
  145.     [ helpstring("SHGetFileInfo: Show icon in selected state") ]
  146.     SHGFI_SELECTED           = 0x00010000,
  147.     [ helpstring("SHGetFileInfo: Get large icon") ]
  148.     SHGFI_LARGEICON          = 0x00000000,
  149.     [ helpstring("SHGetFileInfo: Get small icon") ]
  150.     SHGFI_SMALLICON          = 0x00000001,
  151.     [ helpstring("SHGetFileInfo: Get open icon") ]
  152.     SHGFI_OPENICON           = 0x00000002,
  153.     [ helpstring("SHGetFileInfo: Get shell size icon") ]
  154.     SHGFI_SHELLICONSIZE      = 0x00000004,
  155.     [ helpstring("SHGetFileInfo: pszPath is a PIDL") ]
  156.     SHGFI_PIDL               = 0x00000008,
  157.     [ helpstring("SHGetFileInfo: Use passed file attributes") ]
  158.     SHGFI_USEFILEATTRIBUTES  = 0x00000010
  159. } ESHGFI;
  160.  
  161. typedef enum ECSIDL {
  162.     [ helpstring("SHGetSpecialFolderLocation: Desktop") ]
  163.     CSIDL_DESKTOP         = 0x0000,
  164.     [ helpstring("SHGetSpecialFolderLocation: Programs") ]
  165.     CSIDL_PROGRAMS        = 0x0002,
  166.     [ helpstring("SHGetSpecialFolderLocation: Control Panel") ]
  167.     CSIDL_CONTROLS        = 0x0003,
  168.     [ helpstring("SHGetSpecialFolderLocation: Printers") ]
  169.     CSIDL_PRINTERS        = 0x0004,
  170.     CSIDL_PERSONAL        = 0x0005,
  171.     CSIDL_FAVORITES       = 0x0006,
  172.     [ helpstring("SHGetSpecialFolderLocation: Startup Directory") ]
  173.     CSIDL_STARTUP         = 0x0007,
  174.     [ helpstring("SHGetSpecialFolderLocation: Most Recently Used Documents") ]
  175.     CSIDL_RECENT          = 0x0008,
  176.     [ helpstring("SHGetSpecialFolderLocation: Send To Menu Items") ]
  177.     CSIDL_SENDTO          = 0x0009,
  178.     [ helpstring("SHGetSpecialFolderLocation: Recycle Bin") ]
  179.     CSIDL_BITBUCKET       = 0x000a,
  180.     [ helpstring("SHGetSpecialFolderLocation: Start Menu Directory") ]
  181.     CSIDL_STARTMENU       = 0x000b,
  182.     [ helpstring("SHGetSpecialFolderLocation: Desktop Directory") ]
  183.     CSIDL_DESKTOPDIRECTORY  = 0x0010,
  184.     [ helpstring("SHGetSpecialFolderLocation: My Computer") ]
  185.     CSIDL_DRIVES          = 0x0011,
  186.     [ helpstring("SHGetSpecialFolderLocation: Network Neighborhood") ]
  187.     CSIDL_NETWORK         = 0x0012,
  188.     [ helpstring("SHGetSpecialFolderLocation: Network Neighborhood Directory") ]
  189.     CSIDL_NETHOOD         = 0x0013,
  190.     [ helpstring("SHGetSpecialFolderLocation: Fonts") ]
  191.     CSIDL_FONTS           = 0x0014,
  192.     [ helpstring("SHGetSpecialFolderLocation: Templates") ]
  193.     CSIDL_TEMPLATES       = 0x0015,
  194.     [ helpstring("SHGetSpecialFolderLocation: Common Start Menu") ]
  195.     CSIDL_COMMON_STARTMENU          = 0x0016,
  196.     [ helpstring("SHGetSpecialFolderLocation: Common Programs") ]
  197.     CSIDL_COMMON_PROGRAMS           = 0X0017,
  198.     [ helpstring("SHGetSpecialFolderLocation: Common Startup") ]
  199.     CSIDL_COMMON_STARTUP            = 0x0018,
  200.     [ helpstring("SHGetSpecialFolderLocation: Common Desktop Directory") ]
  201.     CSIDL_COMMON_DESKTOPDIRECTORY   = 0x0019,
  202.     [ helpstring("SHGetSpecialFolderLocation: Common Application Data") ]
  203.     CSIDL_APPDATA                   = 0x001a,
  204.     [ helpstring("SHGetSpecialFolderLocation: Common Printer Neighborhood") ]
  205.     CSIDL_PRINTHOOD                 = 0x001b
  206. } ECSIDL;
  207.  
  208. typedef enum ESHGDFIL {
  209.     SHGDFIL_FINDDATA     = 1,
  210.     SHGDFIL_NETRESOURCE  = 2
  211. } ESHGDFIL;
  212.  
  213. // Shell function entries and constants
  214. [
  215. #ifdef UNICODE
  216. uuid(64675052-3A82-101B-8181-00AA003743D3),
  217. #else
  218. uuid(64674052-3A82-101B-8181-00AA003743D3),
  219. #endif
  220. helpstring("Shell"),
  221. dllname("SHELL32.DLL")
  222. ]
  223. module Shell {
  224.  
  225.     // Shell functions, types, and definitions
  226.     /*
  227.     UINT WINAPI DragQueryFileA(HDROP,UINT,LPTSTR,UINT);
  228.  
  229.     BOOL WINAPI DragQueryPoint(HDROP,LPPOINT);
  230.  
  231.     VOID WINAPI DragFinish(HDROP);
  232.  
  233.     VOID WINAPI DragAcceptFiles(HWND,BOOL);
  234.     */
  235.  
  236.     /*
  237.     typedef struct _DRAGINFOA {
  238.         UINT uSize;                 // Init with sizeof(DRAGINFO)
  239.         POINTL pt;
  240.         BOOL fNC;
  241.         LPSTR   lpFileList;
  242.         DWORD grfKeyState;
  243.     } DRAGINFOA, FAR* LPDRAGINFOA;
  244.     typedef DRAGINFOA DRAGINFO;
  245.     typedef LPDRAGINFOA LPDRAGINFO;
  246.     */
  247.  
  248.     [
  249.     usesgetlasterror,
  250.     #ifdef UNICODE
  251.     entry("ShellExecuteW"),
  252.     #else
  253.     entry("ShellExecuteA"),
  254.     #endif
  255.     helpstring("Opens or prints specified executable or document file"),
  256.     ]
  257.     HINSTANCE WINAPI ShellExecute(HWND hwnd,
  258.                                   LPCTSTR lpOperation,
  259.                                   LPCTSTR lpFile,
  260.                                   LPCTSTR lpParameters,
  261.                                   LPCTSTR lpDirectory,
  262.                                   ESW nShowCmd); // SW_NORMAL
  263.     [
  264.     usesgetlasterror,
  265.     #ifdef UNICODE
  266.     entry("FindExecutableW"),
  267.     #else
  268.     entry("FindExecutableA"),
  269.     #endif
  270.     helpstring("Retrieves name and handle of executable file associated with the specified filename"),
  271.     ]
  272.     HINSTANCE WINAPI FindExecutable(LPCTSTR lpFile,
  273.                                     LPCTSTR lpDirectory,
  274.                                     LPTSTR lpResult);
  275.  
  276.     // LPWSTR * WINAPI CommandLineToArgvW(LPCWSTR lpCmdLine, int*pNumArgs);
  277.  
  278.     [
  279.     usesgetlasterror,
  280.     #ifdef UNICODE
  281.     entry("ShellAboutW"),
  282.     #else
  283.     entry("ShellAboutA"),
  284.     #endif
  285.     helpstring("Displays an About Box"),
  286.     ]
  287.     INT WINAPI ShellAbout(HWND hWnd, LPCTSTR szApp,
  288.                           LPCTSTR szOtherStuff,
  289.                           HICON hIcon);
  290.  
  291.     // HICON      WINAPI DuplicateIcon(HINSTANCE hInst, HICON hIcon);
  292.  
  293.     [
  294.     usesgetlasterror,
  295.     #ifdef UNICODE
  296.     entry("ExtractAssociatedIconW"),
  297.     #else
  298.     entry("ExtractAssociatedIconA"),
  299.     #endif
  300.     helpstring("Returns handle of indexed icon found in a file or in an associated executable file"),
  301.     ]
  302.     HICON     WINAPI ExtractAssociatedIcon(HINSTANCE hInst,
  303.                                            LPTSTR lpIconPath,
  304.                                            WORD * lpiIcon);
  305.  
  306.     [
  307.     usesgetlasterror,
  308.     #ifdef UNICODE
  309.     entry("ExtractIconW"),
  310.     #else
  311.     entry("ExtractIconA"),
  312.     #endif
  313.     helpstring("Retrieves handle of an icon from given executable file, DLL, or icon file"),
  314.     ]
  315.     HICON     WINAPI ExtractIcon(HINSTANCE hInst,
  316.                                  LPCTSTR lpszExeFileName,
  317.                                  UINT nIconIndex);
  318.  
  319.  
  320.     // AppBar stuff
  321.     /*
  322.     const DWORD ABM_NEW             = 0x00000000;
  323.     const DWORD ABM_REMOVE          = 0x00000001;
  324.     const DWORD ABM_QUERYPOS        = 0x00000002;
  325.     const DWORD ABM_SETPOS          = 0x00000003;
  326.     const DWORD ABM_GETSTATE        = 0x00000004;
  327.     const DWORD ABM_GETTASKBARPOS   = 0x00000005;
  328.     const DWORD ABM_ACTIVATE        = 0x00000006;  // lParam == TRUE/FALSE means activate/deactivate
  329.     const DWORD ABM_GETAUTOHIDEBAR  = 0x00000007;
  330.     const DWORD ABM_SETAUTOHIDEBAR  = 0x00000008;  // This can fail at any time.
  331.                                                    // MUST check the result
  332.                                                    // lParam = TRUE/FALSE  Set/Unset
  333.                                                    // uEdge = what edge
  334.     const DWORD ABM_WINDOWPOSCHANGED = 0x0000009;
  335.  
  336.  
  337.     // these are put in the wparam of callback messages
  338.     const DWORD ABN_STATECHANGE    = 0x0000000;
  339.     const DWORD ABN_POSCHANGED     = 0x0000001;
  340.     const DWORD ABN_FULLSCREENAPP  = 0x0000002;
  341.     const DWORD ABN_WINDOWARRANGE  = 0x0000003; // lParam == TRUE means hide
  342.  
  343.     // flags for get state
  344.     const DWORD ABS_AUTOHIDE       = 0x0000001;
  345.     const DWORD ABS_ALWAYSONTO     = 0x0000002;
  346.  
  347.     const int ABE_LEFT    = 0;
  348.     const int ABE_TOP     = 1;
  349.     const int ABE_RIGHT   = 2;
  350.     const int ABE_BOTTOM  = 3;
  351.     */
  352.  
  353.     /*
  354.     typedef struct _AppBarData
  355.     {
  356.         DWORD cbSize;
  357.         HWND hWnd;
  358.         UINT uCallbackMessage;
  359.         UINT uEdge;
  360.         RECT rc;
  361.         LPARAM lParam; // message specific
  362.     } APPBARDATA, *PAPPBARDATA;
  363.     */
  364.  
  365.     // UINT WINAPI SHAppBarMessage(DWORD dwMessage, PAPPBARDATA pData);
  366.  
  367.     //  EndAppBar
  368.  
  369.     // DWORD WINAPI DoEnvironmentSubstA(LPTSTR szString, UINT cbString);
  370.  
  371.     // LPTSTR WINAPI FindEnvironmentStringA(LPTSTR szEnvVar);
  372.  
  373.     //        #define EIRESID(x) (-1 * (int)(x))
  374.  
  375.     [
  376.     usesgetlasterror,
  377.     #ifdef UNICODE
  378.     entry("ExtractIconExW"),
  379.     #else
  380.     entry("ExtractIconExA"),
  381.     #endif
  382.     helpstring("Extracts the handle of an icon from the specified executable file, DLL, or icon file"),
  383.     ]
  384.     UINT WINAPI ExtractIconEx(LPCTSTR lpszFile, 
  385.                               int nIconIndex,
  386.                               LPVOID phiconLarge,
  387.                               LPVOID phiconSmall,
  388.                               UINT nIcons);
  389.  
  390.     //
  391.     // SHAddToRecentDocs
  392.     //
  393.     [
  394.     usesgetlasterror,
  395.     entry("SHAddToRecentDocs"),
  396.     helpstring("Adds a file to shell list of recently used documents, or clears documents from the list"),
  397.     ]
  398.     void WINAPI SHAddToRecentDocs(ESHARD uFlags, LPTSTR pv);
  399.  
  400.     [
  401.     usesgetlasterror,
  402.     entry("SHAddToRecentDocs"),
  403.     helpstring("Adds an item ID list to shell list of recently used documents, or clears documents from the list"),
  404.     ]
  405.     void WINAPI SHAddToRecentDocsItem(ESHARD uFlags, DWORD pv);
  406.  
  407.     //----------
  408.     //
  409.     // SHGetPathFromIDList
  410.     //
  411.     //  This function assumes the size of the buffer (MAX_PATH). The pidl
  412.     // should point to a file system object.
  413.     //
  414.     //----------
  415.  
  416.     [
  417.     usesgetlasterror,
  418.     #ifdef UNICODE
  419.     entry("SHGetPathFromIDListW"),
  420.     #else
  421.     entry("SHGetPathFromIDListA"),
  422.     #endif
  423.     helpstring("Converts an item ID list pointer to a file system path (cMaxPath buffer expected)"),
  424.     ]
  425.     BOOL WINAPI SHGetPathFromIDList(DWORD pidl, LPTSTR pszPath);
  426.  
  427.  
  428.     // implicit parameters are:
  429.     //      if pFrom or pTo are unqualified names the current directories are
  430.     //      taken from the global current drive/directory settings managed
  431.     //      by Get/SetCurrentDrive/Directory
  432.     //
  433.     //      the global confirmation settings
  434.  
  435.     [
  436.     usesgetlasterror,
  437.     #ifdef UNICODE
  438.     entry("SHFileOperationW"),
  439.     #else
  440.     entry("SHFileOperationA"),
  441.     #endif
  442.     helpstring("Performs a copy, move, rename, or delete operation on a file system object"),
  443.     ]
  444.     int WINAPI SHFileOperation(SHFILEOPSTRUCT * lpFileOp);
  445.  
  446.     /*
  447.     [
  448.     usesgetlasterror,
  449.     entry("SHFileOperationW"),
  450.     helpstring(""),
  451.     ]
  452.     void WINAPI SHFreeNameMappings(HANDLE hNameMappings);
  453.  
  454.     typedef struct SHNAMEMAPPING {
  455.         LPSTR pszOldPath;
  456.         LPSTR pszNewPath;
  457.         int   cchOldPath;
  458.         int   cchNewPath;
  459.     } SHNAMEMAPPING, *LPSHNAMEMAPPING;
  460.     */
  461.  
  462.     ////        #define SHGetNameMappingCount(_hnm)
  463.     //      DSA_GetItemCount(_hnm)
  464.     ////        #define SHGetNameMappingPtr(_hnm, _iItem) \
  465.     //      (LPSHNAMEMAPPING)DSA_GetItemPtr(_hnm, _iItem)
  466.  
  467.     //// End Shell File Operations
  468.  
  469.     //  Begin ShellExecuteEx and family
  470.  
  471.     // ShellExecute() and ShellExecuteEx() error codes
  472.  
  473.     // Regular WinExec() codes
  474.     const int SE_ERR_FNF                = 2;       // file not found
  475.     const int SE_ERR_PNF                = 3;       // path not found
  476.     const int SE_ERR_ACCESSDENIED       = 5;       // access denied
  477.     const int SE_ERR_OOM                = 8;       // out of memory
  478.     const int SE_ERR_DLLNOTFOUND       = 32;
  479.  
  480.  
  481.     // Error values for ShellExecute() beyond the regular WinExec() codes
  482.     const int SE_ERR_SHARE                  = 26;
  483.     const int SE_ERR_ASSOCINCOMPLETE        = 27;
  484.     const int SE_ERR_DDETIMEOUT             = 28;
  485.     const int SE_ERR_DDEFAIL                = 29;
  486.     const int SE_ERR_DDEBUSY                = 30;
  487.     const int SE_ERR_NOASSOC                = 31;
  488.  
  489.     // Note CLASSKEY overrides CLASSNAME
  490.     const DWORD SEE_MASK_CLASSNAME        = 0x00000001;
  491.     const DWORD SEE_MASK_CLASSKEY         = 0x00000003;
  492.     // Note INVOKEIDLIST overrides IDLIST
  493.     const DWORD SEE_MASK_IDLIST           = 0x00000004;
  494.     const DWORD SEE_MASK_INVOKEIDLIST     = 0x0000000c;
  495.     const DWORD SEE_MASK_ICON             = 0x00000010;
  496.     const DWORD SEE_MASK_HOTKEY           = 0x00000020;
  497.     const DWORD SEE_MASK_NOCLOSEPROCESS   = 0x00000040;
  498.     const DWORD SEE_MASK_CONNECTNETDRV    = 0x00000080;
  499.     const DWORD SEE_MASK_FLAG_DDEWAIT     = 0x00000100;
  500.     const DWORD SEE_MASK_DOENVSUBST       = 0x00000200;
  501.     const DWORD SEE_MASK_FLAG_NO_UI       = 0x00000400;
  502.     const DWORD SEE_MASK_UNICODE          = 0x00010000;
  503.  
  504.     /*
  505.     typedef struct _SHELLEXECUTEINFOA
  506.     {
  507.             DWORD cbSize;
  508.             ULONG fMask;
  509.             HWND hwnd;
  510.             LPCSTR   lpVerb;
  511.             LPCSTR   lpFile;
  512.             LPCSTR   lpParameters;
  513.             LPCSTR   lpDirectory;
  514.             ESW      nShow;
  515.             HINSTANCE hInstApp;
  516.             // Optional fields
  517.             LPVOID lpIDList;
  518.             LPCSTR   lpClass;
  519.             HKEY hkeyClass;
  520.             DWORD dwHotKey;
  521.             HANDLE hIcon;
  522.             HANDLE hProcess;
  523.     } SHELLEXECUTEINFOA, *LPSHELLEXECUTEINFOA;
  524.     typedef SHELLEXECUTEINFOA SHELLEXECUTEINFO;
  525.     typedef LPSHELLEXECUTEINFOA LPSHELLEXECUTEINFO;
  526.     */
  527.  
  528.     // BOOL WINAPI ShellExecuteExA(LPSHELLEXECUTEINFOA lpExecInfo);
  529.  
  530.     // void WINAPI WinExecErrorA(HWND hwnd, int error, LPCTSTR lpstrFileName, LPCTSTR lpstrTitle);
  531.  
  532.     //  End ShellExecuteEx and family
  533.  
  534.     // Tray notification definitions
  535.  
  536.     const DWORD NIM_ADD       = 0x00000000;
  537.     const DWORD NIM_MODIFY    = 0x00000001;
  538.     const DWORD NIM_DELETE    = 0x00000002;
  539.  
  540.     const DWORD NIF_MESSAGE   = 0x00000001;
  541.     const DWORD NIF_ICON      = 0x00000002;
  542.     const DWORD NIF_TIP       = 0x00000004;
  543.  
  544.     [
  545.     usesgetlasterror,
  546.     #ifdef UNICODE
  547.     entry("Shell_NotifyIconW"),
  548.     #else
  549.     entry("Shell_NotifyIconA"),
  550.     #endif
  551.     helpstring("Performs a copy, move, rename, or delete operation on a file system object"),
  552.     ]
  553.     BOOL WINAPI Shell_NotifyIcon(DWORD dwMessage,
  554.                                  NOTIFYICONDATA * lpData);
  555.  
  556.     // End Tray Notification Icons
  557.  
  558.     // Begin SHGetFileInfo
  559.  
  560.     /*
  561.      * The SHGetFileInfo API provides an easy way to get attributes
  562.      * for a file given a pathname.
  563.      *
  564.      *   PARAMETERS
  565.      *
  566.      *     pszPath              file name to get info about
  567.      *     dwFileAttributes     file attribs, only used with SHGFI_USEFILEATTRIBUTES
  568.      *     psfi                 place to return file info
  569.      *     cbFileInfo           size of structure
  570.      *     uFlags               flags
  571.      *
  572.      *   RETURN
  573.      *     TRUE if things worked
  574.      */
  575.  
  576.     [
  577.     usesgetlasterror,
  578.     entry("SHGetMalloc"),
  579.     helpstring("Returns a pointer to an IMalloc used to allocate LPITEMID"),
  580.     ]
  581.     HRESULT WINAPI SHGetMalloc(IVBMalloc ** ppMalloc);
  582.  
  583.     [
  584.     usesgetlasterror,
  585.     #ifdef UNICODE
  586.     entry("SHGetFileInfoW"),
  587.     #else
  588.     entry("SHGetFileInfoA"),
  589.     #endif
  590.     helpstring("Retrieves information about a file system object such as a file, a folder, a directory, or a drive root"),
  591.     ]
  592.     DWORD WINAPI SHGetFileInfo(LPCTSTR pszPath,
  593.                                DWORD dwFileAttributes,
  594.                                SHFILEINFO * psfi,
  595.                                UINT cbFileInfo,
  596.                                UINT uFlags);
  597.  
  598.     [
  599.     usesgetlasterror,
  600.     #ifdef UNICODE
  601.     entry("SHGetFileInfoW"),
  602.     #else
  603.     entry("SHGetFileInfoA"),
  604.     #endif
  605.     helpstring("Retrieves information about a special folder specified as an index"),
  606.     ]
  607.     DWORD WINAPI SHGetItemInfo(LONG ordPath,
  608.                                DWORD dwFileAttributes,
  609.                                SHFILEINFO * psfi,
  610.                                UINT cbFileInfo,
  611.                                UINT uFlags);
  612.  
  613.     /*
  614.     BOOL WINAPI SHGetNewLinkInfoA(LPCTSTR pszLinkTo, 
  615.                                   LPCTSTR pszDir,
  616.                                   LPTSTR pszName, 
  617.                                   BOOL * pfMustCopy,
  618.                                   UINT uFlags);
  619.     */
  620.  
  621.     //define SHGNLI_PIDL           0x000000001     // pszLinkTo is a pidl
  622.     //define SHGNLI_PREFIXNAME     0x000000002     // Make name "Shortcut to xxx"
  623.  
  624.     //-------------------------------------------------------------------------
  625.     //
  626.     // SHGetSpecialFolderLocation
  627.     //
  628.     //  Caller should call SHFree to free the returned pidl.
  629.     //
  630.     //-------------------------------------------------------------------------
  631.     //
  632.  
  633.     [
  634.     usesgetlasterror,
  635.     entry("SHGetSpecialFolderLocation"),
  636.     helpstring("Get item ID of special folder location"),
  637.     ]
  638.     HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner,
  639.                                               int nFolder,
  640.                                               /* LPITEMIDLIST * ppidl */
  641.                                               long * ppidl);
  642.  
  643.     // registry entries for special paths are kept in :
  644. #ifdef UNICODE
  645.     const LPTSTR REGSTR_PATH_SPECIAL_FOLDERS  = L"\\Shell Folders";
  646. #else
  647.     const LPTSTR REGSTR_PATH_SPECIAL_FOLDERS  = "\\Shell Folders";
  648. #endif
  649.  
  650.     //-------------------------------------------------------------------------
  651.     //
  652.     // SHBrowseForFolder API
  653.     //
  654.     //-------------------------------------------------------------------------
  655.  
  656.     // message from browser
  657.     const short BFFM_INITIALIZED        = 1;
  658.     const short BFFM_SELCHANGED         = 2;
  659.  
  660.     // messages to browser
  661.     const short BFFM_SETSTATUSTEXT      = WM_USER + 100;
  662.     const short BFFM_ENABLEOK           = WM_USER + 101;
  663.     const short BFFM_SETSELECTION       = WM_USER + 102;
  664.  
  665.     [
  666.     usesgetlasterror,
  667.     #ifdef UNICODE
  668.     entry("SHBrowseForFolderW"),
  669.     #else
  670.     entry("SHBrowseForFolder"),
  671.     #endif
  672.     helpstring("Displays a dialog that allows selection of shell folders"),
  673.     ]
  674.     LPITEMIDLIST WINAPI SHBrowseForFolder(LPBROWSEINFO lpbi);
  675.  
  676.     //-------------------------------------------------------------------------
  677.     //
  678.     // SHLoadInProc
  679.     //
  680.     //   When this function is called, the shell calls CoCreateInstance
  681.     //  (or equivalent) with CLSCTX_INPROC_SERVER and the specified CLSID
  682.     //  from within the shell's process and release it immediately.
  683.     //
  684.     //-------------------------------------------------------------------------
  685.  
  686.     [
  687.     usesgetlasterror,
  688.     entry("SHLoadInProc"),
  689.     helpstring(""),
  690.     ]
  691.     HRESULT WINAPI SHLoadInProc(REFCLSID rclsid);
  692.  
  693.     //
  694.     //  Helper function which returns a IShellFolder interface to the desktop
  695.     // folder. This is equivalent to call CoCreateInstance with CLSID_ShellDesktop.
  696.     //
  697.     //  CoCreateInstance(CLSID_Desktop, NULL,
  698.     //                   CLSCTX_INPROC, IID_IShellFolder, &pshf);
  699.     //
  700.     [
  701.     usesgetlasterror,
  702.     entry("SHGetDesktopFolder"),
  703.     helpstring(""),
  704.     ]
  705.     HRESULT WINAPI SHGetDesktopFolder(LPSHELLFOLDER *ppshf);
  706.  
  707.  
  708.     //
  709.     //  APIs
  710.     //
  711.     [
  712.     usesgetlasterror,
  713.     entry("SHChangeNotify"),
  714.     helpstring(""),
  715.     ]
  716.     void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags,
  717.                                LPCVOID dwItem1, LPCVOID dwItem2);
  718.  
  719.  
  720.     [
  721.     usesgetlasterror,
  722.     entry("SHGetInstanceExplorer"),
  723.     helpstring(""),
  724.     ]
  725.     HRESULT WINAPI SHGetInstanceExplorer(IUnknown **ppunk);
  726.  
  727.     //
  728.     // SHGetDataFromIDListA/W
  729.     //
  730.     [
  731.     usesgetlasterror,
  732.     #ifdef UNICODE
  733.     entry("SHGetDataFromIDListW"),
  734.     #else
  735.     entry("SHGetDataFromIDListA"),
  736.     #endif
  737.     helpstring(""),
  738.     ]
  739.     HRESULT WINAPI SHGetDataFromIDList(LPSHELLFOLDER psf,
  740.                                        LPCITEMIDLIST pidl,
  741.                                        int nFormat,
  742.                                        LPVOID pv,
  743.                                        int cb);
  744.  
  745. }
  746.